package com.oig.sys.auth.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 资源（菜单，按钮） 看是否需要合并 子系统表和权限表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_resource")
public class TbResource implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 */
	@Column(name = "system_id")
	private Integer systemId;

	/**
	 */
	@Column(name = "resource_code", length = 32)
	private String resourceCode;

	/**
	 */
	@Column(name = "resource_name", length = 128)
	private String resourceName;

	/**
	 */
	@Column(name = "status")
	private String status;

	/**
	 */
	@Column(name = "sort")
	private Integer sort;

	/**
	 */
	@Column(name = "ico_class", length = 128)
	private String icoClass;

	/**
	 */
	@Column(name = "parent_id")
	private Integer parentId;

	/**
	 */
	@Column(name = "level")
	private Integer level;

	/**
	 */
	@Column(name = "path_url", length = 128)
	private String pathUrl;

	/**
	 */
	@Column(name = "ui_event", length = 128)
	private String uiEvent;

	/**
	 */
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name", length = 32)
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name", length = 32)
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;


	@Column(name = "no_del_flag")
	private String noDelFlag;	//是否允许删除 1-允许 0-不允许

	@Column(name = "query_type")
	private String queryType;   //是否支持通用查询 0-通用查询 1-接口查询

	@Column(name = "api_url")
	private String apiUrl ;

	/**
	 * 查询json配置
	 */
	@Column(name = "json_text")
	private String jsonText ;

	/**
	 * 通用查询固定查询条件配置
	 * 格式改为：[{"fieldName":"status","symbol":"$in","value":[01,02]},{"fieldName":"payStatus","symbol":"$eq","value":"01"}]
	 */
	@Column(name = "query_condition_cfg")
	private String queryConditionCfg ;
	/**
	 * 通用查询,默认排序配置
	 */
	@Column(name = "query_sort_cfg")
	private String querySortCfg ;

	@Column(name = "is_support_tab")
	private String isSupportTab;

	@Column(name = "tab_cfg_json")
	private String tabCfgJson;

	@Column(name = "is_show")
	private String isShow;

	@Column(name = "is_query_only")
	private String isQueryOnly;

	@Column(name = "is_public_data")
	private String isPublicData;

	/**
	 * 功能说明
	 */
	@Column(name = "remark")
	private String remark;
}
